
class Response:
    STATUS_INFO = {
        200: 'OK',
        404: 'Not Found'
    }

    def __init__(self):
        self.status_code = 200
        self._headers = {}
        self._body = None

    @property
    def status(self):
        return f'{self.status_code} {self.STATUS_INFO[self.status_code]}'

    @property
    def headers(self):
        return [(str(key), str(value)) for key, value in self._headers]

    def set_header(self, key, value):
        self._headers[key] = value

    @property
    def body(self):
        if isinstance(self._body, bytes):
            return self._body
        else:
            return self._body.encode('utf8')

    @body.setter
    def body(self, value):
        self._body = value
